package com.landinfo.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.*;
import javax.validation.constraints.*;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * 任务管理
 * Create by lzq
 * 2017-06-06
 */
@ApiModel(description = "任务管理 Create by lzq 2017-06-06")
@Entity
@Table(name = "task_management")
public class TaskManagement implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
    @SequenceGenerator(name = "sequenceGenerator")
    private Long id;

    /**
     * 任务名称（模板名称）
     */
    @NotNull
    @ApiModelProperty(value = "任务名称（模板名称）", required = true)
    @Column(name = "name", nullable = false)
    private String name;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
    @Column(name = "description")
    private String description;

    /**
     * 图标（模板图标）
     */
    @ApiModelProperty(value = "图标（模板图标）")
    @Column(name = "icon")
    private String icon;

    /**
     * 任务内容（模板内容）
     */
    @ApiModelProperty(value = "任务内容（模板内容）")
    @Lob
    @Column(name = "task_content")
    private String taskContent;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_date")
    private ZonedDateTime createDate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public TaskManagement name(String name) {
        this.name = name;
        return this;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public TaskManagement description(String description) {
        this.description = description;
        return this;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getIcon() {
        return icon;
    }

    public TaskManagement icon(String icon) {
        this.icon = icon;
        return this;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getTaskContent() {
        return taskContent;
    }

    public TaskManagement taskContent(String taskContent) {
        this.taskContent = taskContent;
        return this;
    }

    public void setTaskContent(String taskContent) {
        this.taskContent = taskContent;
    }

    public ZonedDateTime getCreateDate() {
        return createDate;
    }

    public TaskManagement createDate(ZonedDateTime createDate) {
        this.createDate = createDate;
        return this;
    }

    public void setCreateDate(ZonedDateTime createDate) {
        this.createDate = createDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TaskManagement taskManagement = (TaskManagement) o;
        if (taskManagement.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), taskManagement.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "TaskManagement{" +
            "id=" + getId() +
            ", name='" + getName() + "'" +
            ", description='" + getDescription() + "'" +
            ", icon='" + getIcon() + "'" +
            ", taskContent='" + getTaskContent() + "'" +
            ", createDate='" + getCreateDate() + "'" +
            "}";
    }
}
